varying vec3 normal,lightDir,halfVector;
uniform sampler2D texture;
varying vec2 texcoord0;

void main()
{

	vec3 n,halfV;
	float NdotL,NdotHV;		
	
	vec4 color = vec4(0.3,0.3,0.3,1.0);

	vec4 diffuse =texture2D(texture,texcoord0);
	n = normalize(normal);

	float shadow = 0;
	
	NdotL = max(dot(n,lightDir),0.0);

	
	
	n = normalize(normal);
		
	NdotL = max(dot(n,lightDir),0.0);

	if (NdotL > 0.0) {
			color += diffuse * NdotL;
			halfV = normalize(halfVector);
			NdotHV = max(dot(n,halfV),0.0);
			color += vec4(1.0,1.0,1.0,0.0)* 
					vec4(0.6,0.6,1.0,0.0) * 
					pow(NdotHV, 128.0)*0.2;

		}

    gl_FragColor = color;
}
